<script setup>
import {ref} from "vue";
import useCounterStore from "../stores/counter.js";

let counterStore = useCounterStore();

let number = ref(2);

function increment(number) {
  counterStore.increment(number)
}

function decrement(number) {
  counterStore.decrement(number)
}
</script>

<template>
<select v-model.number="number">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
</select>

  <button v-on:click="increment(number)">增加</button>
  <button v-on:click="decrement(number)">减少</button>
</template>

<style scoped>

</style>